<?php include_once($_SERVER['DOCUMENT_ROOT']."/controller/common/common_setting_unit.php");// 引入通用的设置文件 ?>
<?php include_once($_SERVER['DOCUMENT_ROOT']."/controller/common/module/head.php"); // 引入通用的头部 ?>
<?php include_once("../controller/data_add.php");// 当前页面的控制器 ?>
<body>
<!--顶部栏-->
<div id="topbar"> <?php include $_SERVER['DOCUMENT_ROOT'].'/controller/common/module/topbar.php'; ?></div>
<!--容器-->
<div id="container" class="<? echo $now_extender ?>">
    <!--侧边栏-->
    <div id="sidebar"><?php include $_SERVER['DOCUMENT_ROOT'].'/controller/common/module/sidebar.php'; ?></div>
    <!--主内容-->
    <div id="content">
        <!--标题设定-->
        <?php $page_title='添加';?>
        <?php include $_SERVER['DOCUMENT_ROOT'].'/controller/common/module/mod-page-title.php'; ?>
        <?//============================================?>
        <?//以下开发需要注重的部分，主要写前端?>
        <?//============================================?>







           <div class="detail-box">
               <ul class="detail-boxing">

                   <form id="data_form" method="post" class="layui-form"
                         action ="data_add_process.php?<? echo $url_parameter ?>"
                         enctype="multipart/form-data">

                       <input type="hidden"  name="nid" value="<? echo $data['nid']?>" >



                       <!--普通的input文本输入-->
                       <li class="layui-form-item name">
                           <label class="layui-form-label">名称：<? echo $data['$data'] ?></label>
                           <div class="layui-input-block">
                               <input type="text" class="layui-input"  name="ai_title"  value="<? echo $data['title'] ?>">
                               <em class="notice">(<u style="color:red">*必填项目</u>, 填写标题) </em>
                           </div>
                       </li>



                       <!--普通的textarea多行文本输入-->
                       <li class="layui-form-item introduce">
                           <label class="layui-form-label">简介：</label>
                           <div class="layui-input-block">
                               <textarea class="layui-textarea" name="ai_description"  ><?echo  $data['description']?></textarea>
                               <em class="notice">(填写本文的概述)</em>
                           </div>
                       </li>





                       <div class="layui-form-item">
                           <label class="layui-form-label"> 品牌</label>
                           <div class="layui-input-block">
                               <?

                               for($i=0;$i<count($brand_list);$i++){ ?>
                                   <input name="ai_brand[]" type="checkbox" value="<? echo $brand_list[$i]['name'] ?>"
                                       <?php if(in_array($brand_list[$i]['name'],$data_brand)){echo "checked";} ?>
                                          lay-skin="primary"
                                          title="<? echo $brand_list[$i]['name'] ?>"
                                   </input>
                               <? } ?>
                               </select>
                           </div>
                       </div>


                       <style>
                           .layui-form-select dl dd{display: flex;align-items: center;height: 36px;}
                       </style>


                       <!-- 多选 -->
                       <?php include_once('module/mod-multiple-select.php'); ?>

                       <div class="layui-form-item">
                           <label class="layui-form-label">所属产品</label>
                           <div class="layui-input-block" id="select_text_product">

                               <!--

                               <select name="product" lay-search="" value="<? echo $_REQUEST['product']?>">
                                   <option value="">全部</option>
                                   <?php foreach ($product_list as $index => $product) { ?>
                                       <option value="<?php echo $product['name']; ?>"
                                           <?php if ($_REQUEST['product'] == $product['name']) { echo "selected"; } ?>><?php echo $product['name']; ?></option>
                                   <?php } ?>
                               </select>
-->


                           </div>
                       </div>






                       <!--单选项-->
                       <li class="layui-form-item publish">
                           <label class="layui-form-label">文件类型：</label>
                           <div class="layui-input-block">
                               <?foreach ( $file_type_list as $k => $v){?>
                                   <input name='ai_file_type' type='radio' value='<?echo $v?>'
                                       <?if($data['file_type'] == $v){echo "checked='checked''";}?>
                                          title="<?echo $v?>" />
                                   <?;}?>
                           </div>
                       </li>


                       <li class="layui-form-item publish">
                           <label class="layui-form-label">标签：</label>
                           <div class="layui-input-block">
                               <?foreach ( $tag_list as $k => $v){?>
                                   <input name='ai_tag' type='radio' value='<?echo $v?>'
                                       <?if($data['tag'] == $v){echo "checked='checked''";}?>
                                          title="<?echo $v?>" />
                                   <?;}?>
                           </div>
                       </li>

                       <div class="layui-form-item">
                           <label class="layui-form-label"> 资源种类</label>
                           <div class="layui-input-block">
                               <? for($i=0;$i<count($asset_class_list);$i++){ ?>
                                   <input name="ai_asset_class[]" type="checkbox" value="<? echo $asset_class_list[$i] ?>"

                                          lay-skin="primary"
                                          title="<? echo $asset_class_list[$i] ?>"
                                   </input>
                               <? } ?>

                           </div>
                       </div>

                       <div class="layui-form-item">
                           <label class="layui-form-label"> 资源类型</label>
                           <div class="layui-input-block">
                               <?
                               for($i=0;$i<count($asset_type_list);$i++){ ?>
                                   <input name="ai_asset_type[]" type="checkbox" value="<? echo $asset_type_list[$i] ?>"
                                       <?php if(in_array($asset_type_list[$i],$data_asset_type)){echo "checked";} ?>
                                          lay-skin="primary"
                                          title="<? echo $asset_type_list[$i] ?>"
                                   </input>
                               <? } ?>
                               </select>
                           </div>
                       </div>

                       <div class="layui-form-item">
                           <label class="layui-form-label"> 视频时长</label>
                           <div class="layui-input-block">
                               <input name='ai_duration' type='radio' value='1' title="短（5分钟内）" />
                               <input name='ai_duration' type='radio' value='2' title="中（5-20分钟内）" />
                               <input name='ai_duration' type='radio' value='3' title="长（20分钟以上）" />
                           </div>
                       </div>




                       <!--普通的input文本输入-->
                       <li class="layui-form-item name">
                           <label class="layui-form-label">地区：</label>
                           <div class="layui-input-block">
                               <input type="text" class="layui-input"  name="ai_region"  value="<? echo $data['region'] ?>">
                           </div>
                       </li>




                       <!--                       asset_type-->
                       <!--                       asset_category-->
                       <!--                       asset-->
                       <!--                       product_category-->
                       <!--                       product_range-->
                       <!--                       product-->
                       <!--                       has_usages_restrictions-->
                       <!--                       usage_rights-->
                       <!--                       extra_restrictions-->
                       <!--                       watermark-->
                       <!--                       watermark_date-->
                       <!--                       public-->
                       <!--                       archive-->
                       <!--                       archive_date-->
                       <!--                       downloadable-->
                       <!--                       limited-->
                       <!--                       limited_date-->
                       <!--                       created_by-->
                       <!--                       creation_date-->
                       <!--                       published_date-->
                       <!--                       modified_by-->
                       <!--                       modified_date-->
                       <!--                       copyright-->

                       <!--单张图片的上传，需要优化-->
                       <? include("module/mod-image-upload.php");?>







                       <!--单选项-->
                       <li class="layui-form-item publish">
                           <label class="layui-form-label">发布状态：</label>
                           <div class="layui-input-block">
                               <input name='ai_publish' type='radio' value='发布' title="立即发布"
                                   <? if ($data['publish'] == '发布') {echo "checked='checked'";} ?>/>
                               <input name='ai_publish' type='radio' value='隐藏' title="暂未发布"
                                   <? if ($data['publish'] == '隐藏') {echo "checked='checked'";} ?>/>
                               <br class="clearfloat"/>
                               <em class="notice">(选择立即发布，以上信息才能在前台显示；选择暂未发布，只对以上信息进行保存，不在前台显示)</em>
                           </div>
                       </li>


                       <!--时间选择-->
                       <li class="layui-form-item inputtime">
                           <label class="layui-form-label">发布时间：</label>
                           <div class="layui-input-block">
                               <input type="text" class="laydate-icon laydate_time layui-input"
                                      name="ai_applydate" autocomplete="off" required
                                      value="<? echo $data['applydate']; ?>"
                               >
                               <em class="notice">(填写发布的时间)</em>
                           </div>
                       </li>





                       <div class="function">

                           <button class="layui-btn"  lay-submit type="submit" >立即提交</button>
                           <input type="reset" class="layui-btn" value="重置"/>

                           <a 	class="layui-btn layui-btn-normal" href="#content1" style="margin-left: 35px">基本信息</a>
                           <a 	class="layui-btn layui-btn-normal" href="#content2">SEO设置</a>
                       </div>



                   </form>


               </ul>
           </div>







        <?//============================================?>
        <?//以下JS部分需要根据实际情况去加载?>
        <?//============================================?>

    </div>
    <!--content end-->
<br class="clearfloat"/>
<!--container  end-->
</div>

<?//============================================?>
<?//JS加载区域?>
<?//============================================?>
<script>
</script>




<!--底部栏-->
<?php include $_SERVER['DOCUMENT_ROOT']."/controller/common/module/footer.php"; ?>

